import React, { Component } from 'react';
import "./miaosha.css"
import Mytime from '../Catelist/Mytime';

import request from "../../api"

interface Props {

}
interface State {
    seckilllist: ListItem[]
}
interface ListItem {
    img1: string,
    originprice: number
}

class Miaosha extends Component<Props, State> {
    constructor(props: Props) {
        super(props)
        this.state = {
            seckilllist: []
        }
    }
    componentDidMount(): void {
        
        request.mypro.pro_seckilllist().then((ok: any) => {
            console.log(ok.data.data);
            this.setState({ seckilllist: ok.data.data }, () => {
                console.log(this.state.seckilllist);
            })

        })
    }
    
    render() {
        return (
            <div className='miaosha'>
                <Mytime></Mytime>
                <div className='seckilllist'>
                    {
                        
                        this.state.seckilllist.map((item, index) => {
                            return (
                                <div className='list' key={index}>
                                    <img src={item.img1} alt="" />
                                    <div>{item.originprice}</div>
                                </div>
                            )
                        })
                    }
                </div>
               
            </div>
        );
    }
}

export default Miaosha;